package com.changgou.business.listener;

import com.changgou.business.service.AdService;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@org.springframework.amqp.rabbit.annotation.RabbitListener(queues = "ad_update_queue")
public class RabbitListener {
    @Autowired
    private AdService adService;
     @RabbitHandler
    public void message(String message){

        adService.updatetoRedis(message);
    }
}
